<?php
include_once $_SERVER['DOCUMENT_ROOT'] . "/conf/config.php";

if (!$_POST['SEQNO']) {
	echo json_endoce(array('response' => 'error'));
	exit();
}

$query = "select * from qr_data where SEQNO = " . $_POST['SEQNO'];

$dbconn = @mysql_connect($dbhost, $dbuser, $dbpass);
@mysql_select_db($dbname, $dbconn);

$result = @mysql_query($query, $dbconn);
$row = @mysql_fetch_array($result);

$response = array(
				'response'	=>	'success',
				'img_loc'	=>	"/" . $code_loc,
				'seqno' 	=> 	$row['SEQNO'],
				'oldsi'		=>	$row['OLDSI'],
				'oldgu'		=>	$row['OLDGU'],
				'olddong'	=>	$row['OLDDONG'],
				'oldbunji'	=>	$row['OLDBUNJI'],
				'newsi'		=>	$row['NEWSI'],
				'newgu'		=>	$row['NEWGU'],
				'newdong'	=>	$row['NEWDONG'],
				'newbunji'	=>	$row['NEWBUNJI'],
    			'used'		=>	$row['USED'],
    			'uint'		=>	$row['UNIT'],
    			'cpic'		=>	$row['CPIC'],
    			'cdate'		=>	$row['CDATE'], 
    			'lat'		=>	$row['LAT'],
    			'lng'		=>	$row['LNG'],
    			'png'		=>	$row['PNG']);

echo json_encode($response);
?>